<?php

class CommonPage extends Module{

	public function __construct(){
		$this->author = "Tomáš Voslař";
		$this->name = "Obecná stránka";
		$this->presenter = "CommonPage";
		$this->version = "0.1";
		$this->params = "";
	}

	public function getSql(){
			
		dibi::query("CREATE TABLE IF NOT EXISTS `page` (
  				`id_page` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  				`id_menu` mediumint(8) unsigned NOT NULL,
  				`content` text NOT NULL,
  				PRIMARY KEY (`id_page`),
  				KEY `fk_id_menu` (`id_menu`)
				) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
				");
		
		dibi::query("ALTER TABLE `page`
 				 ADD CONSTRAINT `page_ibfk_1` FOREIGN KEY (`id_menu`) REFERENCES `menu` (`id_menu`) ON DELETE CASCADE ON UPDATE CASCADE;");
			
	}

}

?>